using System;
using System.Collections.Generic;
using System.Text;

namespace RapidHDL
{
    public class MainClock : ClockComponent 
    {
        private RapidHardware oRapidHardware;
        int iFrequency;

        public MainClock(RapidHardware poRapidHardware)
            : base(poRapidHardware.Structure.TopLevelComponent, "main_clock")
        {
            oRapidHardware = poRapidHardware;
            poRapidHardware.Simulation.Clock.MainClock = this;
        }

        public int Frequency
        {
            set { iFrequency = value; }
            get { return iFrequency; }
        }

        public override void GenerateStructure()
        {
            oRapidHardware.Simulation.Clock.Frequency = iFrequency;
        }
    }
}
